home *** CD-ROM | disk | FTP | other *** search
/ Treccani Italiana Di Scienze Lettere Ed Arti / [Enciclopedia] Treccani Italiana di scienze lettere ed arti.iso / pc / data / xxi_appendice_dvd.swf / scripts / __Packages / CProspettiveController.as < prev    next >
Text File  |  2007-11-08  |  2KB  |  79 lines

  1. class CProspettiveController extends mx.core.UIObject
  2. {
  3.    function CProspettiveController()
  4.    {
  5.       super();
  6.       this.doLater(this,"init");
  7.    }
  8.    function init(Void)
  9.    {
  10.       this.play_btn.addEventListener("click",mx.utils.Delegate.create(this,this.onPlayPauseClick));
  11.       this.rewind_btn.addEventListener("click",mx.utils.Delegate.create(this,this.onRewindClick));
  12.       this.setState("pause");
  13.    }
  14.    function onPlayPauseClick(evtObj)
  15.    {
  16.       var _loc2_ = this.getState();
  17.       if(_loc2_ == "pause")
  18.       {
  19.          this.sendVideoEvent("play");
  20.       }
  21.       else
  22.       {
  23.          this.sendVideoEvent("pause");
  24.       }
  25.    }
  26.    function onStopClick(evtObj)
  27.    {
  28.       this.sendVideoEvent("stop");
  29.    }
  30.    function onRewindClick(evtObj)
  31.    {
  32.       this.sendVideoEvent("stopAndRewind");
  33.    }
  34.    function sendVideoEvent(inEvent, inArg)
  35.    {
  36.       this.dispatchEvent({type:"onControllerEvent",target:this,event:inEvent,eventArg:inArg});
  37.    }
  38.    function onStateChange(inState)
  39.    {
  40.       this.setState(inState);
  41.    }
  42.    function onVideoLoad(inPercentage)
  43.    {
  44.    }
  45.    function getState()
  46.    {
  47.       if(this.play_btn.getState())
  48.       {
  49.          return "play";
  50.       }
  51.       return "pause";
  52.    }
  53.    function setState(inState)
  54.    {
  55.       if(inState == "play")
  56.       {
  57.          this.play_btn.setState(true);
  58.       }
  59.       else
  60.       {
  61.          this.play_btn.setState(false);
  62.       }
  63.    }
  64.    function SetTimeText(inCurentFrame, inTotalFrame)
  65.    {
  66.    }
  67.    function onScrub(inScrubPos)
  68.    {
  69.    }
  70.    function SetEnabled(enable)
  71.    {
  72.       this.mEnabled = enable;
  73.       this.rewind_btn.enabled = enable;
  74.       this.stop_btn.enabled = enable;
  75.       this.setState("pause");
  76.       this.play_btn.enabled = enable;
  77.    }
  78. }
  79.